package billeterie;

import java.util.ArrayList;

public abstract class Show 
{
	protected String name;
	protected String description;
	protected double price;
	protected int ticketsRemaining;
	protected int id;
	
	public String getName() 
	{
		return name;
	}

	public void setName(String name) 
	{
		this.name = name;
	}
	
	public String getDescription() 
	{
		return description;
	}

	public void setDescription(String description) 
	{
		this.description = description;
	}
	public double getPrice() 
	{
		return price;
	}

	public void setPrice(double price) 
	{
		this.price = price;
	}

	public int getTicketsRemaining() 
	{
		return ticketsRemaining;
	}

	public int getId() {
		return id;
	}

	protected void initValues(int id, String name, String description, double price, int ticketCount)
	{
		this.id = id;
		this.name = name;
		this.description = description;
		this.price = price;
		this.ticketsRemaining = ticketCount;
	}

	public abstract ArrayList<Ticket> getTickets(int quantity);

	public ArrayList<Ticket> createTickets(int quantity, Show s) 
	{
		ArrayList<Ticket> list = new ArrayList<Ticket>();
		
		for(int i = 0; i < quantity; i++)
		{
			list.add(TicketsFactory.getTickets(this));
		}
		return list;
	}
	
	public void substractTickets(int ticketsCount)
	{
		ticketsRemaining -= ticketsCount;
	}
}
